<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
        <%@page import="java.util.*"%>
        <%@page import="edu.byu.isys413.group1E.handlers.*"%>
        <%@page import="edu.byu.isys413.group1E.data.*"%>
        <%@page import="java.util.ArrayList.*"%>
        <%@page import="java.text.DecimalFormat"%>
        
        <%   
        TransactionBO TXBO = (TransactionBO)request.getAttribute("TX");
        ArrayList<TransLineBO> TLList = TXBO.getTxLineList();
        DecimalFormat fmt = new DecimalFormat();
        fmt.setMinimumFractionDigits(2);
        fmt.setMaximumFractionDigits(2);    
        %>
        
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Untitled Document</title>

        <style type="text/css">
            <!--
* {
	font-family: tahoma;
}
body {
	background-color: #354153;
}
.title{
background-color: #708BB2; 
color:#FFFFFF; padding:5px; 
font-size:12px; 
font-weight:bold; 
border:1px solid; 
width:222px;
}
.bottom{
background-color: #708BB2; 
color:#FFFFFF; padding:1px; 
font-size:8px;  border:1px solid; 
width:232px; height:40px;
}
.tablething
{
border-collapse:collapse; color:#FFFFFF; font-size:10px; border-top:0px; border-left:2px solid;
}
.add
{
background-image:url(images/remove.gif); 
width:12px; 
height:12px; 
border:0px; 
padding:0px; 
margin:0px;
}
.shade {
	position:absolute;
	margin:0px;
	background-color:#242C38;
	background-position:left;
	background-repeat:no-repeat;
	height:385px;
	width:234px;
	opacity: 0.8;
	filter:alpha(opacity=80);-moz-opacity:0.8;
	visibility:hidden;
}

            -->
    </style></head><body onload="parent.clear = false;">
<div class="shade" id="shade" name="shade"></div>  
        <div class="title">
            <table style="padding: 0px;" border="0" cellpadding="3" cellspacing="0">
                <tbody><tr>
                        <td width="25"><img src="images/shoppingcart.gif" height="23" width="25"></td>
                        <td width="100%">
                            <div align="center">
                            My Shopping Cart</div>
                        </td>
                    </tr>
            </tbody></table>
        </div>
        <div style="border-color: rgb(255, 255, 255); border-left: 1px none rgb(255, 255, 255); overflow: auto; height: 300px; width: 234px;" align="right">
            <table class="tablething" border="1" bordercolor="#ffffff" cellpadding="3" cellspacing="0" width="100%">
                <!-- THIS IS THE LOOP -->
                <%for(int counter = 0; counter<TLList.size(); counter++) {   %>
                <tbody><tr>
                        <form id="additem<%=counter%>" name="additem<%=counter%>" method="post" action="edu.byu.isys413.actions.removeItem.action">
                            <td><%=TLList.get(counter).getRevSrc().getDescription()%></td>
                            <%String lineAmount = fmt.format(TLList.get(counter).getLineAmount());  %>
                            <td align="right" width="30">$<%=lineAmount%></td>
                            <td width="10">      
                                <input type="hidden" name="id"   value="<%=TLList.get(counter).getTxLineID()%>" />
                                <input type="submit" name="Submit" value=""  class="add" />	 
                        </td></form>
                    </tr>
                    <% }//end for Loop%>
            </tbody></table>
        </div>
        <div class="bottom" style="width:230px;" >
            <table border="1" cellpadding="0" cellspacing="0" width="100%" style="font-size:10px; border-collapse:collapse; border-color:#CCCCCC;">
                <tbody><tr>
                        <td align="center" width="25%"><strong>Subtotal</strong></td>
                        <td align="center" width="25%"><strong>Tax</strong></td>
                        <td align="center" width="25%"><strong>Total</strong></td>
                        <td rowspan="2">
                            <form action="edu.byu.isys413.actions.clickcheckout.action" target="main" name="clickcheckout" id="clickcheckout" style="margin:0px;">
                                <div onClick="document.clickcheckout.submit(); document.getElementById('shade').style.visibility = 'visible';" style="border: 0px none ; color:#000000; text-decoration: none; font-weight:bold;" align="center">
                                    <img src="images/checkout.gif" border="0" height="25" width="25"><br>
                            Checkout</div></form>
                        </td>
                    </tr>
                    <tr>
                        <%String subTotal = fmt.format(TXBO.getTransSubTotal());  
                        String tax = fmt.format(TXBO.getTransTax()); 
                        String total = fmt.format(TXBO.getTransTotal()); 
                        %>
                        <td align="center"><strong style="color:#333333;">$<%=subTotal%></strong></td>
                        <td align="center"><strong style="color:#333333;">$<%=tax%></strong></td>
                        <td align="center">
                            <div style="border: 3px double; border-color: #990000;">
                        <strong style="color:#000000;">$<%=total%></strong></div>		  </td>
                    </tr>
            </tbody></table>
        </div>
        
</body></html>
</table>
</div>

</body>

</html>
